package com.sojoys.artifact.manager;

import com.sojoys.artifact.factory.distributedId.IDistributedIdProvider;
import com.sojoys.artifact.factory.distributedId.IDistributedIdProviderFactory;

/**
 * @author : DengYing
 * @CreateDate : 2017年10月18日 下午6:00:27
 * @Description ：分布式ID管理器
 */
public class DistributedIdManager {
	
	private DistributedIdManager() {
	}

	private static DistributedIdManager ME = new DistributedIdManager();

	public static DistributedIdManager me() {
		return ME;
	}
	
	private IDistributedIdProviderFactory factory;

	public void setDefaultFactory(IDistributedIdProviderFactory factory) {
		this.factory = factory;
	}
	
	public IDistributedIdProvider getProvider(){
		return factory.getProvider();
	}
}
